import * as path from 'path';
import { ProcessPool } from '../src/processPool';

const pool = new ProcessPool(5);

for (let i = 0; i < 30; i ++) {
  pool.addTask({
    id: Math.random().toString(),
    executableFilePath: path.join(__dirname, './worker1'),
    args: [],
  });
}

for (let i = 0; i < 30; i ++) {
  pool.addTask({
    id: Math.random().toString(),
    executableFilePath: path.join(__dirname, './worker2'),
    args: [],
  });
}

pool.createAgent('agent', path.join(__dirname, './agent'));